﻿var tdtKey = "6703c18da8b111f1ac38fdcfc4a138d8";

function initMap(options) {
  var map = new ol.Map(setOptions(getCesiumParameter(), options));
  return map;
}

function getCesiumParameter() {
  var layer = new ol.layer.Tile({
    name: "OSM",
    source: new ol.source.OSM(),
  });
  return {
    layers: [layer],
    target: "map", //地图容器div的ID
    //地图视图设置
    view: new ol.View({
      center: [0, 0],
      projection: ol.proj.get("EPSG:4326"),
      zoomFactor: 2,
      maxZoom: 18,
      zoom: 5,
    }),
  };
}

function setOptions(defaults, options) {
  return Object.assign({}, defaults, options);
}
